// 1.0 导入vue核心包
import Vue from 'vue';

// 2.0 导入App.vue的vue对象
import App from './App.vue';

import vueRouter from 'vue-router';
Vue.use(vueRouter);

import 'mint-ui/lib/style.min.css';
// 导入mint-ui组件对象
import mintui from 'mint-ui';
// 在Vue中全局使用mintui
Vue.use(mintui);

// 5.0 注册mui的css样式
import '../statics/mui/css/mui.css';

// 6.0 导入一个当前系统的全局基本样式
import '../statics/css/site.css';

import home from "./components/Home.vue";
import shopcar from "./components/shopcar/car.vue";
import newslist from './components/news/newslist.vue';
import newsinfo from './components/news/newsinfo.vue';

import vueResource from "vue-resource";
Vue.use(vueResource);

import moment from "moment";
Vue.filter("datefmt",function(input,string){
	return moment(input).format(string);
})

var router1 = new vueRouter({
	linkActiveClass : "mui-active",
	routes : [
		{path : "/home", component : home},
		{path : "/shopcar", component : shopcar},
		{path : "/news/newslist", component : newslist},
		{path : "/news/newsinfo/:id", component : newsinfo}
	]
});

new Vue({
	el:'#app',
	router: router1,
	// render:function(create){create(App)} //es5的写法
	render:c=>c(App)  // es6的函数写法 =>：goes to
});